import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class ExpandedComp extends StatelessWidget {
  const ExpandedComp({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      height: double.infinity,
      decoration: const BoxDecoration(color: Colors.red),
      alignment: Alignment.topLeft,
      child: Container(
        width: double.infinity,
        height: 120,
        padding: const EdgeInsets.all(10),
        decoration: const BoxDecoration(color: Colors.yellow),
        child: Row(
          children: [
            // 左侧图片
            ClipRRect(
              borderRadius: BorderRadius.circular(10),
              child: Image.network(
                  'https://img2.baidu.com/it/u=1666858871,666753767&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=962'),
            ),
            const SizedBox(
              width: 10,
            ),
            // 右侧弹性盒子
            const Expanded(
                child: Column(
              children: [
                Text('《春宵》 苏轼 \n 春宵一刻值千金，花有清香月有阴。 歌管楼台声细细，秋千院落夜沉沉。'),
                Text('')
              ],
            ))
          ],
        ),
      ),
    );
  }
}
